package com.zdx.yswl.ui.activity;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.umeng.analytics.MobclickAgent;
import com.zdx.yswl.App;
import com.zdx.yswl.R;
import com.zdx.yswl.tool.KSystemTool;
import com.zdx.yswl.ui.base.BaseActivity;

public class SetActivity extends BaseActivity {


	@Override
	protected void initSettings()
	{

	}

	@Override
	protected void initUi()
	{

	}

	@Override
	protected void saveSettings()
	{

	}

	@Override
	protected void freeMe()
	{

	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.activity_setting);
		
		setHeader("设置");
		
		ImageView userHead = (ImageView) findViewById(R.id.head_img);
		TextView userName = (TextView) findViewById(R.id.user_name_tv);
		Button logOff = (Button) findViewById(R.id.setting_log_off);
		TextView version = (TextView) findViewById(R.id.version_tv);
		userName.setText(App.getInstance().getUserName(this));
		version.setText("V"+KSystemTool.getAppVersionName(this));
		logOff.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				App.getInstance().recordUserId(SetActivity.this, "");
				startActivity(new Intent(SetActivity.this, LoginActivity.class));
				finish();
			}
		});
	}
	
	
	/**友盟session的统计*/
	protected void onResume() {
		super.onResume();
		MobclickAgent.onResume(this);
	}

	/**友盟session的统计*/
	protected void onPause() {
		super.onPause();
		MobclickAgent.onPause(this);
	}

	@Override
	public void onNotify(int what, int arg1, int arg2, Object obj)
	{

	}

	@Override
	public void onHandler(int what, int arg1, int arg2, Object obj)
	{

	}
}
